package cn.gson.crm.controller.classroom;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import cn.gson.crm.controller.BaseServlet;
import cn.gson.crm.model.dao.ClassroomDao;

/**
 * 分配班级的实现
 */
@WebServlet("/class/already/allocation")
public class ClassAlreadyAllocation extends BaseServlet {
	private static final long serialVersionUID = 1L;
    private ClassroomDao crd = new ClassroomDao();
	@Override
	protected void get(HttpServletRequest request, HttpServletResponse response) throws Exception {
		super.get(request, response);
		String[] sids = request.getParameterValues("sids");
		for (int i = 2; i < sids.length; i++) {
			crd.allocationClassByClassId(Integer.parseInt(sids[0]), Integer.parseInt(sids[1]),Integer.parseInt(sids[i]));
		}
		redirect("class/all");
	}
}
